package com.student.Activitys.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.student.Activitys.R;
import com.student.Activitys.adapter.base.BaseRecyleViewAdapter;
import com.student.Activitys.adapter.viewholder.EvaluateViewHolder;
import com.student.Activitys.bean.ScheduleTestingBean;

import java.util.List;

/**
 * 项目名称：智慧校园学生端
 * 类描述：评价 Adapter
 * 创建人：张飞祥
 * 创建时间：2017/10/9 11:13
 * 修改人：张飞祥
 * 修改时间：2017/10/9 11:13
 * 修改备注：
 */
public class EvaluateAdapter extends BaseRecyleViewAdapter {

    public Context context;
    public List<ScheduleTestingBean> list;

    public EvaluateAdapter(Context context, List<ScheduleTestingBean> list) {
        super(context, list);
        this.context = context;
        this.list = list;
    }

    @Override
    protected int getLayoutItmeResId() {
        return R.layout.item_evaluate;
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
        if (holder instanceof EvaluateViewHolder) {
            EvaluateViewHolder viewHolder = (EvaluateViewHolder) holder;
            //将数据保存在itemView的Tag中，以便点击时进行获取
            viewHolder.itemView.setTag(position);
            viewHolder.itemEvaluateTitle.setText(list.get(position).getWDMC());
        }
    }

    @Override
    public RecyclerView.ViewHolder getViewHolder(View view) {
        return new EvaluateViewHolder(view);
    }
}
